package com.joseph.common.result;

import com.joseph.common.exception.RpcException;
import lombok.*;

import java.io.Serializable;

@Data
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class RpcResult<T> extends Result<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private boolean rpcSuccess;

    public void checkRpcResult() {
        if (!rpcSuccess) {
            throw new RpcException("rpc 调用异常");
        }
    }

    /**
     * 返回成功消息
     *
     * @return 成功消息
     */
    public static<T> RpcResult<T> success() {
        return super.
    }

}
